package com.zdkj.edge.door.demo.utils;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.List;

/**
 * @Description:
 * @Author: xuc
 * @Date: 2025-04-27-20:06
 */
@Getter
@AllArgsConstructor
public enum CarEventTypeEnum {
    IDENTIFY(1, Arrays.asList("1","2","7","8")),

    HEAD(2,Arrays.asList("3","5")),

    OTHER(3,Arrays.asList("4","6","9","10","11","12"));

    private final Integer code;

    private final List<String> descriptions;

    public static Integer getByName(String name) {
        for (CarEventTypeEnum entranceEnum : CarEventTypeEnum.values()) {
            if (entranceEnum.getDescriptions().contains(name)) {
                return entranceEnum.getCode();
            }
        }
        return null;
    }


}
